import { HttpModule } from '@nestjs/axios';
import { Global, Module } from '@nestjs/common';
import { QiniuService } from './services/qiniu.service';
import { EmailService } from './services/email.service';
import { SmsService } from './services/sms.service';
import { BullModule } from '@nestjs/bullmq';
import { CodeService } from './services/code.service';
import { WechatService } from './services/wechat.service';
import { WepayService } from './services/wepay.service';

@Global()
@Module({
  imports: [
    HttpModule.register({
      timeout: 5000,
    }),
    // 短信队列
    BullModule.registerQueue({
      name: 'sms',
    }),
    // 通知队列
    BullModule.registerQueue({
      name: 'notify',
    }),
  ],
  providers: [
    EmailService,
    QiniuService,
    SmsService,
    CodeService,
    WechatService,
    WepayService,
  ],
  exports: [
    EmailService,
    QiniuService,
    SmsService,
    CodeService,
    WechatService,
    WepayService,
  ],
})
export class KitsModule {}
